p $tmp=0
while $tmp<$cpu_number
  eval "tvariable $per_cpu_c_%d",$tmp
  eval "tvariable $per_cpu_cy_%d",$tmp
  eval "tvariable $per_cpu_tmp_0_%d",$tmp
  eval "tvariable $per_cpu_tc_%d",$tmp
  eval "tvariable $per_cpu_tcy_%d",$tmp
  eval "tvariable $per_cpu_tmp_1_%d",$tmp
  p $tmp=$tmp+1
end

trace e1000_clean_rx_irq
  commands
    teval $per_cpu_c_0=$per_cpu_c_0+1
    teval $per_cpu_tmp_0_0=$clock
  end
list e1000_clean_rx_irq
trace 1239 if ($per_cpu_c_0>100)
  commands
    teval $per_cpu_cy_0=$clock-$per_cpu_tmp_0_0+$per_cpu_cy_0
  end

list e1000_clean_rx_irq
trace 1117
  commands
    teval $per_cpu_tmp_1_0=$clock
  end
list e1000_clean_rx_irq
trace 1211 if ($per_cpu_c_0>100)
#trace 1200 if ($per_cpu_c_0>100)
  commands
    teval $per_cpu_tc_0=$per_cpu_tc_0+1
    teval $per_cpu_tcy_0=$clock-$per_cpu_tmp_1_0+$per_cpu_tcy_0
  end

define showall
p $per_cpu_cy_0/($per_cpu_c_0-100)
p $per_cpu_tcy_0/$per_cpu_tc_0
end

#define showall
#p $tmp=0
#p $all1=0
#p $all2=0
#while $tmp<$cpu_number
#  eval "p $per_cpu_cy_%d/($per_cpu_c_%d-100)",$tmp,$tmp
#  eval "p $all1=$all1+$per_cpu_cy_%d/($per_cpu_c_%d-100)",$tmp,$tmp

#  eval "p $per_cpu_tcy_%d/$per_cpu_tc_%d",$tmp,$tmp
#  eval "p $all2=$all2+$per_cpu_tcy_%d/$per_cpu_tc_%d",$tmp,$tmp

#  p $tmp=$tmp+1
#end
#p $all1/$cpu_number
#p $all2/$cpu_number
#end
